package com.qc.wintrax.activity;

import android.os.Bundle;
import android.widget.LinearLayout;

import com.qc.wintrax.BaseActivity;
import com.qc.wintrax.R;
import com.qc.wintrax.widget.AreaChartView;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import greendao.MapInfo;

/**
*@auther xbd  created (海拔页面)at 2016/9/20 14:51
*/
public class ElevationActivity extends BaseActivity {

    @Bind(R.id.elevation_view)
    AreaChartView elevationView;

    private List<MapInfo> mapInfoList;
    private List<Double> altList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_elevation);
        ButterKnife.bind(this);
//        mapInfoList = WTApplication.getInstance().getInfoList();
//        altList = WTApplication.getInstance().getAltList();
//        for (int a = 0; a < altList.size(); a++) {
//            double vv = altList.get(a);
//            LogUtil.e("获取的数组是----" + vv);
//        }
//
//        String[] xdata = {"", "", "", "5", "", "", "", "10"};
//        float[] ydata = {1, 2, 3, 4, 3, 6, 5, 1};
//        Double[] aa = (Double[]) altList.toArray(new Double[altList.size()]);
//        LogUtil.e("获取的数组是----" + aa);
//        ToastUtil.show(context, aa.length + "");
//
//        LineChart lineChart = (LineChart) findViewById(R.id.linechart);
//        LineChartData lineChartData = LineChartData.builder()
//                .setXdata(xdata)  //x轴数据
//                .setYdata(ydata)  //y轴数据
//                .setyMax(56)
//                .setYpCount(7)   //y轴刻度数量
//                .setCoordinatesColor(getResources().getColor(android.R.color.holo_orange_dark))
//                .setXpCount(xdata.length)
//                .setAnimType(Anim.ANIM_NONE)  //动画效果，目前仅支持两种
//                .build();
//        lineChart.setChartData(lineChartData);

//        AreaChartView view = new AreaChartView(context);
//        elevationLayout.addView(view);
//        ArrayList<ElevationView.Bar> barLists = new ArrayList<ElevationView.Bar>();
//        for (int i = 0; i < 300; i++) {
//            float ratio = (float) Math.random();
//            int color = (int) (Color.BLACK);
//            ElevationView.Bar bar = view.new Bar(i, ratio, color, "", "");
//            barLists.add(bar);
//        }
//        view.setBarLists(barLists);
    }
}
